<?php
include_once('../includes/definer.php');
include_once(INC.'admin/php/bootstrap.php');
include_once(INC.'admin/php/clases/Texto.php');
$results = array();
$alea = rand(1, 999);
$novedades = Novedades::getInstance();
foreach ($novedades->imagenes() as $imagen) {
    $n = array();
    $n['alea'] = $alea;
    $n['id'] = $imagen->id;
    $n['titulo'] = utf8_encode($imagen->titulo);
    $n['descripcion'] = Texto::cortar(utf8_encode($imagen->descripcion), 55, '...');
    $n['src'] = $imagen->src;
    $n['url'] = URL;
    $results[] = $n;
}
$results = json_encode($results);
header("Content-type: application/json");
echo($results);
?>